package zhongbo.java.air.common.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 说明：
 *
 * @author 钟波dellNotebook
 * @since 2025年03月30日 星期日 13:44:23
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessException extends RuntimeException {

    private ExceptionCode code = ExceptionCode.ERROR;

    public BusinessException() {
    }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String message, Throwable cause) {
        super(message, cause);
    }

    public BusinessException(Throwable cause) {
        super(cause);
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public BusinessException(ExceptionCode code) {
        this.code = code;
    }

    public BusinessException(String message, ExceptionCode code) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause, ExceptionCode code) {
        super(message, cause);
        this.code = code;
    }

    public BusinessException(Throwable cause, ExceptionCode code) {
        super(cause);
        this.code = code;
    }

    public BusinessException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, ExceptionCode code) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
    }

}
